home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / nkcache / nsICacheService.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  6KB  |  153 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsICacheService.idl
  3.  */
  4.  
  5. #ifndef __gen_nsICacheService_h__
  6. #define __gen_nsICacheService_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsICache_h__
  14. #include "nsICache.h"
  15. #endif
  16.  
  17. /* For IDL files that don't want to include root IDL files. */
  18. #ifndef NS_NO_VTABLE
  19. #define NS_NO_VTABLE
  20. #endif
  21. class nsISimpleEnumerator; /* forward declaration */
  22.  
  23. class nsICacheListener; /* forward declaration */
  24.  
  25. class nsICacheSession; /* forward declaration */
  26.  
  27. class nsICacheVisitor; /* forward declaration */
  28.  
  29.  
  30. /* starting interface:    nsICacheService */
  31. #define NS_ICACHESERVICE_IID_STR "de114eb4-29fc-4959-b2f7-2d03eb9bc771"
  32.  
  33. #define NS_ICACHESERVICE_IID \
  34.   {0xde114eb4, 0x29fc, 0x4959, \
  35.     { 0xb2, 0xf7, 0x2d, 0x03, 0xeb, 0x9b, 0xc7, 0x71 }}
  36.  
  37. class NS_NO_VTABLE nsICacheService : public nsISupports {
  38.  public: 
  39.  
  40.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICACHESERVICE_IID)
  41.  
  42.   /**
  43.      * Create a cache session
  44.      *
  45.      * A cache session represents a client's access into the cache.  The cache
  46.      * session is not "owned" by the cache service.  Hence, it is possible to
  47.      * create duplicate cache sessions.  Entries created by a cache session
  48.      * are invisible to other cache sessions, unless the cache sessions are
  49.      * equivalent.
  50.      *
  51.      * @param clientID - Specifies the name of the client using the cache.
  52.      * @param storagePolicy - Limits the storage policy for all entries
  53.      *   accessed via the returned session.  As a result, devices excluded
  54.      *   by the storage policy will not be searched when opening entries
  55.      *   from the returned session.
  56.      * @param streamBased - Indicates whether or not the data being cached
  57.      *   can be represented as a stream.  The storagePolicy must be 
  58.      *   consistent with the value of this field.  For example, a non-stream-
  59.      *   based cache entry can only have a storage policy of STORE_IN_MEMORY.
  60.      * @return new cache session.
  61.      */
  62.   /* nsICacheSession createSession (in string clientID, in nsCacheStoragePolicy storagePolicy, in boolean streamBased); */
  63.   NS_IMETHOD CreateSession(const char *clientID, nsCacheStoragePolicy storagePolicy, PRBool streamBased, nsICacheSession **_retval) = 0;
  64.  
  65.   /**
  66.      * Visit entries stored in the cache.  Used to implement about:cache.
  67.      */
  68.   /* void visitEntries (in nsICacheVisitor visitor); */
  69.   NS_IMETHOD VisitEntries(nsICacheVisitor *visitor) = 0;
  70.  
  71.   /**
  72.      * Evicts all entries in all devices implied by the storage policy.
  73.      */
  74.   /* void evictEntries (in nsCacheStoragePolicy storagePolicy); */
  75.   NS_IMETHOD EvictEntries(nsCacheStoragePolicy storagePolicy) = 0;
  76.  
  77. };
  78.  
  79. /* Use this macro when declaring classes that implement this interface. */
  80. #define NS_DECL_NSICACHESERVICE \
  81.   NS_IMETHOD CreateSession(const char *clientID, nsCacheStoragePolicy storagePolicy, PRBool streamBased, nsICacheSession **_retval); \
  82.   NS_IMETHOD VisitEntries(nsICacheVisitor *visitor); \
  83.   NS_IMETHOD EvictEntries(nsCacheStoragePolicy storagePolicy); 
  84.  
  85. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  86. #define NS_FORWARD_NSICACHESERVICE(_to) \
  87.   NS_IMETHOD CreateSession(const char *clientID, nsCacheStoragePolicy storagePolicy, PRBool streamBased, nsICacheSession **_retval) { return _to CreateSession(clientID, storagePolicy, streamBased, _retval); } \
  88.   NS_IMETHOD VisitEntries(nsICacheVisitor *visitor) { return _to VisitEntries(visitor); } \
  89.   NS_IMETHOD EvictEntries(nsCacheStoragePolicy storagePolicy) { return _to EvictEntries(storagePolicy); } 
  90.  
  91. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  92. #define NS_FORWARD_SAFE_NSICACHESERVICE(_to) \
  93.   NS_IMETHOD CreateSession(const char *clientID, nsCacheStoragePolicy storagePolicy, PRBool streamBased, nsICacheSession **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateSession(clientID, storagePolicy, streamBased, _retval); } \
  94.   NS_IMETHOD VisitEntries(nsICacheVisitor *visitor) { return !_to ? NS_ERROR_NULL_POINTER : _to->VisitEntries(visitor); } \
  95.   NS_IMETHOD EvictEntries(nsCacheStoragePolicy storagePolicy) { return !_to ? NS_ERROR_NULL_POINTER : _to->EvictEntries(storagePolicy); } 
  96.  
  97. #if 0
  98. /* Use the code below as a template for the implementation class for this interface. */
  99.  
  100. /* Header file */
  101. class nsCacheService : public nsICacheService
  102. {
  103. public:
  104.   NS_DECL_ISUPPORTS
  105.   NS_DECL_NSICACHESERVICE
  106.  
  107.   nsCacheService();
  108.  
  109. private:
  110.   ~nsCacheService();
  111.  
  112. protected:
  113.   /* additional members */
  114. };
  115.  
  116. /* Implementation file */
  117. NS_IMPL_ISUPPORTS1(nsCacheService, nsICacheService)
  118.  
  119. nsCacheService::nsCacheService()
  120. {
  121.   /* member initializers and constructor code */
  122. }
  123.  
  124. nsCacheService::~nsCacheService()
  125. {
  126.   /* destructor code */
  127. }
  128.  
  129. /* nsICacheSession createSession (in string clientID, in nsCacheStoragePolicy storagePolicy, in boolean streamBased); */
  130. NS_IMETHODIMP nsCacheService::CreateSession(const char *clientID, nsCacheStoragePolicy storagePolicy, PRBool streamBased, nsICacheSession **_retval)
  131. {
  132.     return NS_ERROR_NOT_IMPLEMENTED;
  133. }
  134.  
  135. /* void visitEntries (in nsICacheVisitor visitor); */
  136. NS_IMETHODIMP nsCacheService::VisitEntries(nsICacheVisitor *visitor)
  137. {
  138.     return NS_ERROR_NOT_IMPLEMENTED;
  139. }
  140.  
  141. /* void evictEntries (in nsCacheStoragePolicy storagePolicy); */
  142. NS_IMETHODIMP nsCacheService::EvictEntries(nsCacheStoragePolicy storagePolicy)
  143. {
  144.     return NS_ERROR_NOT_IMPLEMENTED;
  145. }
  146.  
  147. /* End of implementation class template. */
  148. #endif
  149.  
  150. #define NS_CACHESERVICE_EMPTYCACHE_TOPIC_ID "cacheservice:empty-cache"
  151.  
  152. #endif /* __gen_nsICacheService_h__ */
  153.